package com.ysw.rpc.client.utils;

import io.netty.channel.Channel;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author YinShangwen
 * @since 2023/4/18 11:59
 */
public class CacheUtil {
    private static final Map<String, String> CLASS_SERVER_MAP = new ConcurrentHashMap<>();
    private static final Map<String, Map<String, Channel>> SERVER_CHANNEL_MAP = new ConcurrentHashMap<>();
    private static final Map<String, AtomicInteger> SERVER_COUNT = new ConcurrentHashMap<>();

    public static Map<String, String> getClassServerCache() {
        return CLASS_SERVER_MAP;
    }

    public static Map<String, Map<String, Channel>> getServerChannelCache() {
        return SERVER_CHANNEL_MAP;
    }

    public static Map<String, AtomicInteger> getServerCountCache() {
        return SERVER_COUNT;
    }

}
